import { ApiProperty } from '@nestjs/swagger';
import { Priority, TaskStatus } from '../../../types/enums';

export class TaskResponseDto {
  @ApiProperty({
    description: '任务ID',
    example: '123e4567-e89b-12d3-a456-426614174000',
  })
  id: string;

  @ApiProperty({
    description: '任务标题',
    example: '完成登录页面设计',
  })
  title: string;

  @ApiProperty({
    description: '任务描述',
    example: '根据UI设计稿完成登录页面的前端实现，包括表单验证和错误提示。',
  })
  description: string;

  @ApiProperty({
    description: '所属项目ID',
    example: '123e4567-e89b-12d3-a456-426614174000',
  })
  projectId: string;

  @ApiProperty({
    description: '项目信息',
    type: 'object',
    properties: {
      id: { type: 'string' },
      name: { type: 'string' },
      description: { type: 'string' }
    }
  })
  project: {
    id: string;
    name: string;
    description: string;
  };

  @ApiProperty({
    description: '指派人ID',
    example: '123e4567-e89b-12d3-a456-426614174000',
  })
  assigneeId: string;

  @ApiProperty({
    description: '指派人信息',
    type: 'object',
    properties: {
      id: { type: 'string' },
      username: { type: 'string' },
      fullName: { type: 'string' },
      email: { type: 'string' }
    }
  })
  assignee: {
    id: string;
    username: string;
    fullName: string;
    email: string;
  };

  @ApiProperty({
    description: '创建人ID',
    example: '123e4567-e89b-12d3-a456-426614174000',
  })
  createdById: string;

  @ApiProperty({
    description: '创建人信息',
    type: 'object',
    properties: {
      id: { type: 'string' },
      username: { type: 'string' },
      fullName: { type: 'string' }
    }
  })
  createdBy: {
    id: string;
    username: string;
    fullName: string;
  };

  @ApiProperty({
    description: '任务状态',
    enum: TaskStatus,
    example: TaskStatus.TODO,
  })
  status: TaskStatus;

  @ApiProperty({
    description: '优先级',
    enum: Priority,
    example: Priority.MEDIUM,
  })
  priority: Priority;

  @ApiProperty({
    description: '开始日期',
    example: '2023-01-01T00:00:00Z',
  })
  startDate: Date;

  @ApiProperty({
    description: '截止日期',
    example: '2023-01-15T00:00:00Z',
  })
  dueDate: Date;

  @ApiProperty({
    description: '创建时间',
    example: '2023-01-01T00:00:00Z',
  })
  createdAt: Date;

  @ApiProperty({
    description: '更新时间',
    example: '2023-01-01T00:00:00Z',
  })
  updatedAt: Date;
} 